package com.corpgovernment.permission;

import com.ctrip.corp.obt.generic.utils.Conditional;

/**
 * @author zl.cui
 * @date 2024/3/7
 */
public interface MenuConfig {
    /**
     * Get the value associated with a key.
     *
     * @param k Key to lookup in the config.
     * @return Value for the key or null if no key is present.
     */
    String get(String k);

    default Boolean enable() {
        String v = get("enable");
        return Conditional.ofNullable(v).map(Boolean::valueOf).orElse(Boolean.TRUE);
    }


}
